package com.demo.controller;

import com.demo.pojo.EmployeeEntry;
import com.demo.pojo.ResultVO;
import com.demo.service.EmployeeEntryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/entry")
public class EmployeeEntryController {

    @Autowired
    private EmployeeEntryService employeeEntryService;

    // 新增入职登记
    @PostMapping("/add")
    public ResultVO<?> addEntry(@RequestBody EmployeeEntry entry) {
        employeeEntryService.save(entry);
        return ResultVO.success("新增成功");
    }

    // 根据name查询入职信息
    @GetMapping("/get/{name}")
    public ResultVO<EmployeeEntry> getByEmployeeName(@PathVariable String name) {
        EmployeeEntry entry = employeeEntryService.getByEmployeeName(name);
        return ResultVO.success(entry);
    }

    // 其他接口：如更新状态、分页查询等...
}